<template>
  <a-card :bordered="false">
    <div class="table-page-search-wrapper">

      <div class="table-operator" style="border-top: 5px">
        <a-button type="primary" @click="handleAdd">新增</a-button>
      </div>

      <a-table
        ref="table"
        rowKey="id"
        size="middle"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        @change="handleTableChange">
        <span slot="img" slot-scope="text">
          <img :src="text" alt="" class="thumbnail" />
        </span>
        <span slot="status" slot-scope="text, record">
          <a-switch :checked="record.status == 0" @click="handleSwitch(record,$event ? ischoose : noChoose)"></a-switch>
        </span>
        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record)">
            <a-icon type="edit"/>
            编辑
          </a>
          <a-divider type="vertical"/>
          <a-popconfirm title="确定删除吗?" @confirm="() =>handleDelete(record.id)">
            <a>删除</a>
          </a-popconfirm>
        </span>
      </a-table>
    </div>

    <background-Modal ref="modalForm" @ok="modalFormOk"></background-Modal> 
  </a-card>
</template>

<script>
import { filterObj } from '@/utils/util';
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import backgroundModal from './modules/backgroundModal'

export default {
  name:'',
  mixins:[JeecgListMixin],
  components: { 
    backgroundModal
  },
  data() {
    return {
      removeVisible: false,
      qrCode:'',
      queryParam:{
        current: 1,
        size: 10,
      },
      // 表头
      columns: [
        {
          title: '序号',
          dataIndex: '',
          key: 'rowIndex',
          width: 120,
          align: "center",
          customRender: function (t, r, index) {
            return parseInt(index) + 1;
          }
        },
        {
          title: '背景图',
          dataIndex: 'url',
          align: 'center',
          width: 100,
          scopedSlots: { customRender: 'img' }
        },
        {
          title: '备注',
          align: "center",
          dataIndex: 'bz',
        },
        {
          title: '状态',
          align: 'center',
          dataIndex: 'status',
          scopedSlots: { customRender: 'status' }
        },
        {
          title: '操作',
          align: "center",
          dataIndex: 'action',
          scopedSlots: {customRender: 'action'},
        }
      ],
      url: {
      //   list: "/backend/coffee/pageStoreVo",
      //   delete: "/backend/coffee/delStoreById",
      },
      dataSource:[
        {
          pp:'江南布衣1',
          bz: '备注',
          status: 0
        }
      ]
    }
  },
  created() {

  },
  methods: {
    getQueryParams() {
      // var param = Object.assign({}, this.queryParam);
      // param.current = this.ipagination.current;
      // param.pageSize = this.ipagination.pageSize;
      // return filterObj(param);
    },
  }
}
</script>
<style scoped>
  @import '~@assets/less/common.less'
</style>